package com.xj.opcua.server.manager;

import java.util.concurrent.CompletableFuture;
import org.springframework.stereotype.Service;

import com.xj.opcua.server.Server;

@Service
public class OpcUaServerManager {
	
	public void bootstrap(){
		
		Server server;
		try {
			server = new Server();
			server.startup().get();
	        final CompletableFuture<Void> future = new CompletableFuture<>();
	        Runtime.getRuntime().addShutdownHook(new Thread(() -> future.complete(null)));
	        future.get();
	        
		} catch (Exception e) {
			e.printStackTrace();
		}

        
		
	}

}
